package cn.nexttec.noteplayer.ui.activities

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import cn.nexttec.noteplayer.databinding.ActivityMarkdownViewerBinding
import com.gci.lib_markdown_editor.viewer.MarkdownView

class MarkdownViewerActivity : AppCompatActivity(), MarkdownView.MarkdownListener {
    private lateinit var _binding:ActivityMarkdownViewerBinding
    private val binding get() = _binding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        _binding = ActivityMarkdownViewerBinding.inflate(layoutInflater)
        setContentView(binding.root)

        binding.viewer.setOnMarkdownListener(this)
//        binding.viewer.loadMarkdownFromFile(File(Environment.getExternalStorageDirectory(),"math.md"))
        binding.viewer.loadMarkdownFromAssets("Markdown使用指南.md")
    }

    override fun onUrlClicked(url: String?) {

    }

    override fun onPageLoadFinished() {

    }
}